//
//  ShowmeViewController.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/7/19.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "ShowmeViewController.h"
#import "MyOrderViewController.h"
#import "MyAttentionViewController.h"
#import "MyCollectionViewController.h"
#import "MyCompetitionViewController.h"
#import "MydataEditViewController.h"
#import "LoginUserViewController.h"
#import "RegisterNewPhoneCodeViewController.h"
#import "AddressManagerViewController.h"
#import "MyPersonSettingViewController.h"
#import "MyChangeSecrectViewController.h"
#import "MySuggestionBackViewController.h"
#import "QQAndWechatShareView.h"
#import "MyInstitutionViewController.h"
#import "MyShoppingCarViewController.h"
#import "MyEmblemViewController.h"
#import "MyMoneyViewController.h"
#import "WXApi.h"
#import "MyMatchRecordViewController.h"
#import "AppDelegate.h"
#import "OrganationApplayINViewController.h"
#import "InstituSubmiteOverView.h"
#import "LoginUserViewController.h"
@interface ShowmeViewController ()<UITableViewDelegate,UITableViewDataSource,UIViewControllerTransitioningDelegate>{
        AppDelegate *appdelegate;
}
@property(nonatomic,strong)UITableView *tablview;
@property(nonatomic,strong)UIImageView *headerimageView;
@property(nonatomic,strong)UIView *middleView;
@property(nonatomic, nonnull,strong)NSArray *firstTitileArray;
@property(nonatomic, nonnull,strong)NSArray *secondTitileArray;
@property(nonatomic,strong)NSArray *threeTitleArray;

@property(nonatomic, nonnull,strong)NSArray *firstTitileInstituArray;
@property(nonatomic, nonnull,strong)NSArray *secondTitileInstituArray;
@property(nonatomic,strong)NSArray *threeTitleInstituArray;

@property(nonatomic,assign) BOOL isLogin;
@property(nonatomic,strong)QQAndWechatShareView *shareView;
@property(nonatomic,strong)NSArray *firstImagsArray;
@property(nonatomic,strong)NSArray *twoImagsArray;
@property(nonatomic,strong)NSArray *threeImagsArray;

@property(nonatomic,strong)NSArray *firstImagsInsituArray;
@property(nonatomic,strong)NSArray *twoImagsInsituArray;
@property(nonatomic,strong)NSArray *threeImagsInsituArray;

@property(nonatomic,copy)NSString *userGrads;
@property(nonatomic,copy)NSString *userScore;
@property(nonatomic,strong)NSDictionary *personDict;
@property(nonatomic,strong)UIView *backView;
@property(nonatomic,strong)InstituSubmiteOverView *submitView;
@property(nonatomic,copy)NSString *chooseTypeId;
@property(nonatomic,strong)UIImage *backImage;
@end

@implementation ShowmeViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    
}
-(void)viewWillAppear:(BOOL)animated{
    _isLogin = YES;
    NSLog(@"视图将要出现");
    for (UIView *subviews in self.view.subviews) {
        [subviews removeFromSuperview];
    }
    NSLog(@"这是身份认证的值%ld",[[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] integerValue]);
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] integerValue] == 0) {
        self.navigationItem.title = @"身份认证";
        [self createPeopleCountChooseView];
    }else{
        self.navigationItem.title = @"";
        [self.navigationController.navigationBar setBackgroundImage:[UIImage new]
                                                  forBarMetrics:UIBarMetricsDefault];
        self.navigationController.navigationBar.shadowImage = [UIImage new];
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] integerValue] == 1) {
            [self createTableViewUI];
            [self getUserScore];
            [self getUserGrad];
        }else{
            [self createTableViewUI];
            [self getUserScore];
            [self getUserGrad];
        }
    }
    self.tabBarController.tabBar.hidden = NO;
}
-(void)createNavagationBackBtn{
    [super createNavagationBackBtn];
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    backBtn.frame = CGRectMake(0, 0 , 0, 0);
    UIImageView *backImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@""]];
    backImg.frame = CGRectMake(-10, 10,0, 0);
    [backBtn addSubview:backImg];
    [backImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(backBtn.mas_left).offset(-10);
        make.centerY.equalTo(backBtn.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(22, 22));
    }];
    UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
    [self.navigationItem setLeftBarButtonItem:leftButton];
}
-(void)viewWillDisappear:(BOOL)animated{
    if (![[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"]) {
//        self.navigationItem.title = @"身份认证";
//        [self createPeopleCountChooseView];
    }else{
        //        if (@available(iOS 11.0 ,*)) {
        //            self.navigationController.navigationBar.prefersLargeTitles = true;
        //        }
        [self.navigationController.navigationBar setBackgroundImage:nil
                                                      forBarMetrics:UIBarMetricsDefault];
        self.navigationController.navigationBar.shadowImage = nil;
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] isEqual:@"0"]) {
//            [self createTableViewUI];
//            [self getUserScore];
//            [self getUserGrad];
        }else{
            
        }
    }
//    if (@available(iOS 11.0 ,*)) {
//        self.navigationController.navigationBar.prefersLargeTitles = false;
//    }
//    self.navigationController.navigationBar.subviews.firstObject.alpha = 1;
}
/**
 创建头部视图
 */
-(void)createHeaderViewInview:(UIView *)faterView{
    if (_isLogin) {
        _headerimageView = [[UIImageView alloc] init];
        _headerimageView.userInteractionEnabled = YES;
        [faterView addSubview:_headerimageView];
        [_headerimageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.right.equalTo(faterView);
            make.height.mas_equalTo(scaleTopAndBottom(230));
        }];
        // blur效果
        UIVisualEffectView *visualEfView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]];
        visualEfView.frame = CGRectMake(0, 0, WIDTH, scaleTopAndBottom(230));
        NSLog(@"%@",NSStringFromCGRect(visualEfView.frame));
        visualEfView.alpha = 0.8f;
        [_headerimageView addSubview:visualEfView];
        [_headerimageView sd_setImageWithURL:[NSURL URLWithString:[[NSUserDefaults standardUserDefaults] objectForKey:@"HEADERICON"]] placeholderImage:[UIImage imageNamed:@"DefaultICon"]];
        UIImageView *iconImageView = [[UIImageView alloc] init];
        [iconImageView sd_setImageWithURL:[NSURL URLWithString:[[NSUserDefaults standardUserDefaults] objectForKey:@"HEADERICON"]] placeholderImage:[UIImage imageNamed:@"DefaultICon"]];
        [_headerimageView addSubview:iconImageView];
        [iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(75), scaleTopAndBottom(75)));
            make.centerX.equalTo(_headerimageView.mas_centerX);
            make.top.equalTo(_headerimageView.mas_top).offset(scaleTopAndBottom(50));
        }];
        iconImageView.layer.cornerRadius = scaleTopAndBottom(37.5);
        iconImageView.layer.masksToBounds = YES;
        if (self.backImage) {
            iconImageView.image = self.backImage;
            _headerimageView.image = self.backImage;
        }
        UIImageView *sexImageView = [[UIImageView alloc] init];
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"GENDER"] integerValue]) {
            sexImageView.image = [UIImage imageNamed:@"男"];
        }
        if (![[[NSUserDefaults standardUserDefaults] objectForKey:@"GENDER"] integerValue]) {
            sexImageView.image = [UIImage imageNamed:@"女"];
        }
        if ([self.personDict allKeys].count != 0) {
            if (self.personDict[@"gender"]) {
               sexImageView.image = [UIImage imageNamed:@"男"];
            }else{
                sexImageView.image = [UIImage imageNamed:@"女"];
            }
        }
        
        [_headerimageView addSubview:sexImageView];
        [sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(_headerimageView.mas_centerX);
        make.top.equalTo(iconImageView.mas_bottom).offset(scaleTopAndBottom(13));
            make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(15), scaleTopAndBottom(15)));
        }];
        UILabel *nameLabel = [[UILabel alloc] init];
        nameLabel.textColor = [UIColor whiteColor];
        nameLabel.font = [UIFont systemFontOfSize:14];
        if ([[NSUserDefaults standardUserDefaults] objectForKey:@"NAME"]) {
            nameLabel.text = [[NSUserDefaults standardUserDefaults] objectForKey:@"NAME"];
        }
        if ([self.personDict allKeys].count != 0) {
            NSLog(@"这不是为空的吗%@",self.personDict);
            nameLabel.text = self.personDict[@"name"];
        }


        nameLabel.textAlignment = NSTextAlignmentRight;
        [_headerimageView addSubview:nameLabel];
        [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_headerimageView.mas_left);
            make.right.equalTo(sexImageView.mas_left).offset(-2);
            make.top.equalTo(iconImageView.mas_bottom).offset(scaleTopAndBottom(10));
            make.height.mas_equalTo(scaleTopAndBottom(20));
        }];
        UILabel *xiaofenfenLabel = [[UILabel alloc] init];
        xiaofenfenLabel.text = @"粉丝量: 0";
        xiaofenfenLabel.textColor = [UIColor whiteColor];
        xiaofenfenLabel.font = [UIFont systemFontOfSize:11];
        [_headerimageView addSubview:xiaofenfenLabel];
        [xiaofenfenLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(sexImageView.mas_right).offset(scaleLeftAndRight(10));
                make.right.equalTo(_headerimageView.mas_right);
            make.top.equalTo(iconImageView.mas_bottom).offset(scaleTopAndBottom(10));
                make.height.mas_equalTo(scaleTopAndBottom(20));
        }];
        UILabel *titleLabel = [[UILabel alloc] init];
        if ([[NSUserDefaults standardUserDefaults] objectForKey:@"AUTOGRA"]) {

            NSString *autograph = [[NSUserDefaults standardUserDefaults] objectForKey:@"AUTOGRA"];
            NSLog(@"个性签名%@",autograph);
            titleLabel.text = autograph;
        }

        if ([self.personDict allKeys].count != 0) {
            NSLog(@"这是字典的所有个数%ld",[self.personDict allKeys].count);
            titleLabel.text = self.personDict[@"autograph"];
        }
        titleLabel.textColor = [UIColor whiteColor];
        titleLabel.font = [UIFont systemFontOfSize:12];
        titleLabel.textAlignment = NSTextAlignmentCenter;
        [_headerimageView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(_headerimageView.mas_centerX);
            make.top.equalTo(nameLabel.mas_bottom).offset(scaleTopAndBottom(5));
            make.size.mas_equalTo(CGSizeMake(WIDTH, scaleTopAndBottom(20)));
        }];
        [self createLabelsInView:_headerimageView AndunderView:titleLabel];
        UIImageView * badgeImageView = [[UIImageView alloc] init];
        badgeImageView.image = [UIImage imageNamed:@"badge"];
        [_headerimageView addSubview:badgeImageView];
        [badgeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(20, 25));
            make.bottom.equalTo(xiaofenfenLabel.mas_top).offset(scaleTopAndBottom(-10));
            make.left.equalTo(iconImageView.mas_right).offset(scaleLeftAndRight(-15));
        }];
    }else{
        [self createNOLogUIInView:faterView];
    }
    _middleView = [[UIView alloc] init];
    [faterView addSubview:_middleView];
    [_middleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.headerimageView.mas_bottom);
        make.left.right.equalTo(faterView);
        make.height.mas_equalTo(scaleTopAndBottom(45));
    }];
    UIView *lineVeiw = [[UIView alloc] init];
    [_middleView addSubview:lineVeiw];
    [lineVeiw mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(_middleView);
        make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(1), scaleTopAndBottom(40)));
    }];
    UIButton *lefeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    lefeBtn.titleLabel.font = [UIFont systemFontOfSize:17];
    [lefeBtn setImage:[UIImage imageNamed:@"tujijifen"] forState:UIControlStateNormal];
    [lefeBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    NSString *scroeStr = [NSString stringWithFormat:@" %@ %@",@"吉吉积分",self.userScore];
    [lefeBtn setTitle:scroeStr forState:UIControlStateNormal];
    lefeBtn.tag = 10001;
    [self.middleView addSubview:lefeBtn];
    [lefeBtn addTarget:self action:@selector(ButtonOnclick:) forControlEvents:UIControlEventTouchUpInside];
    UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [rightBtn setTitle:@" 我的关注 0" forState:UIControlStateNormal];
    rightBtn.titleLabel.font = [UIFont systemFontOfSize:17];
    [rightBtn setImage:[UIImage imageNamed:@"showmeguanzhu"] forState:UIControlStateNormal];
    [rightBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    rightBtn.tag = 10002;
    [rightBtn addTarget:self action:@selector(ButtonOnclick:) forControlEvents:UIControlEventTouchUpInside];
    [self.middleView addSubview:rightBtn];
    [lefeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.top.equalTo(_middleView);
        make.right.equalTo(lineVeiw.mas_left).offset(scaleLeftAndRight(-1));
    }];
    [rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.bottom.top.equalTo(_middleView);
        make.left.equalTo(lineVeiw.mas_right).offset(scaleLeftAndRight(1));
    }];
    _headerimageView.backgroundColor = [UIColor cyanColor];
    _middleView.backgroundColor = [UIColor whiteColor];
    lineVeiw.backgroundColor = [UIColor lightGrayColor];
    
}

/**
 创建未登录时的界面
 */
-(void)createNOLogUIInView:(UIView *)fatherView{
    _headerimageView = [[UIImageView alloc] init];
    _headerimageView.userInteractionEnabled = YES;
    [fatherView addSubview:_headerimageView];
    [_headerimageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.equalTo(fatherView);
        make.height.mas_equalTo(scaleTopAndBottom(230));
    }];
    UILabel *titleLabel = [[UILabel alloc] init];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.text = @"Hi,等你好久了";
    [_headerimageView addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_headerimageView.mas_top).offset(scaleTopAndBottom(110));
        make.left.right.equalTo(_headerimageView);
        make.height.mas_equalTo(scaleTopAndBottom(30));
    }];
    UIButton *loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [loginBtn setTitle:@"登录" forState:UIControlStateNormal];
    [loginBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [loginBtn addTarget:self action:@selector(gotoLogInOrRegisterNewAccount:) forControlEvents:UIControlEventTouchUpInside];
    [_headerimageView addSubview:loginBtn];
    UIButton *regsiterBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [regsiterBtn setTitle:@"注册" forState:UIControlStateNormal];
    [regsiterBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [regsiterBtn addTarget:self action:@selector(gotoLogInOrRegisterNewAccount:) forControlEvents:UIControlEventTouchUpInside];
    [_headerimageView addSubview:regsiterBtn];
    loginBtn.tag = 101;
    regsiterBtn.tag = 102;
    [loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
       make.bottom.equalTo(_headerimageView.mas_bottom).offset(scaleTopAndBottom(-20));
        make.left.equalTo(_headerimageView.mas_left).offset(scaleLeftAndRight(100));
        make.height.mas_equalTo(scaleTopAndBottom(30));
    }];
    [regsiterBtn mas_makeConstraints:^(MASConstraintMaker *make) {
      make.bottom.equalTo(_headerimageView.mas_bottom).offset(scaleTopAndBottom(-20));
        make.right.equalTo(_headerimageView.mas_right).offset(scaleLeftAndRight(-100));
        make.height.mas_equalTo(scaleTopAndBottom(30));
        make.left.equalTo(loginBtn.mas_right).offset(scaleLeftAndRight(20));
        make.width.equalTo(loginBtn.mas_width);
    }];
    loginBtn.backgroundColor = [UIColor purpleColor];
    regsiterBtn.backgroundColor = [UIColor purpleColor];

}

/**
 选择登录还是注册
 */
-(void)gotoLogInOrRegisterNewAccount:(UIButton *)btn{
    if (btn.tag == 101) {
        LoginUserViewController *logInVc = [[LoginUserViewController alloc] init];
        [self presentViewController:logInVc animated:YES completion:nil];
    }
    if (btn.tag == 102) {
        RegisterNewPhoneCodeViewController *registerVc = [[RegisterNewPhoneCodeViewController alloc] init];
        registerVc.headerTitile = @"手机号注册";
        registerVc.isRegister = YES;
        registerVc.type = @"0";
        registerVc.transitioningDelegate = self;
        registerVc.modalPresentationStyle = UIModalPresentationCustom;
        [self presentViewController:registerVc animated:YES completion:nil];
    }
}
/**
   初始化tablview
 */
-(void)createTableViewUI{
    self.tablview = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
    [self.view addSubview:self.tablview];
    [self.tablview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self.view);
        make.top.equalTo(self.view);
        make.bottom.equalTo(self.view.mas_bottom).offset(-49);
    }];
    self.tablview.delegate = self;
    self.tablview.dataSource = self;
    UIView *footerView = [[UIView alloc] init];
    self.tablview.tableFooterView = footerView;
    NSString *version = [UIDevice currentDevice].systemVersion;
    if (version.doubleValue >= 11.0) {
        if (@available(iOS 11.0, *)) {
            self.tablview.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
        } else {
            // Fallback on earlier versions
        }
    }
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 4;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    if (section == 1) {
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] integerValue] == 1) {
            return self.firstTitileArray.count;
        }
        return self.firstTitileInstituArray.count;
    }else if (section ==2){
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] integerValue] == 1) {
            return self.secondTitileArray.count;
        }
        return self.secondTitileInstituArray.count;
    }else if(section == 3){
        if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
            if ([WXApi isWXAppInstalled]) {
                
                return self.threeTitleArray.count;
            }else{
                return self.threeTitleArray.count - 1;
            }
        }
        return self.threeTitleArray.count;
       
    }else{
        return 1;
    }
    
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *cellId = @"CellID";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
    }
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    if (indexPath.section == 1) {
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] integerValue] == 1) {
            cell.imageView.image = [UIImage imageNamed:self.firstImagsArray[indexPath.row]];
            cell.textLabel.text = self.firstTitileArray[indexPath.row];
        }else{
            cell.imageView.image = [UIImage imageNamed:self.firstImagsInsituArray[indexPath.row]];
            cell.textLabel.text = self.firstTitileInstituArray[indexPath.row];
        }
    }else if(indexPath.section == 2){
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] integerValue] == 1) {
            cell.imageView.image = [UIImage imageNamed:self.twoImagsArray[indexPath.row]];
            cell.textLabel.text = self.secondTitileArray[indexPath.row];
        }else{
            cell.imageView.image = [UIImage imageNamed:self.twoImagsInsituArray[indexPath.row]];
            cell.textLabel.text = self.secondTitileInstituArray[indexPath.row];
        }

    }else if(indexPath.section == 3){
        cell.imageView.image = [UIImage imageNamed:self.threeImagsArray[indexPath.row]];
        cell.textLabel.text = self.threeTitleArray[indexPath.row];
    }else{
        [self createHeaderViewInview:cell.contentView];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.accessoryType = UITableViewCellAccessoryNone;
    }
    
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return indexPath.section == 0? scaleTopAndBottom(275):UITableViewAutomaticDimension;

}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView *view = [[UIView alloc] init];
    view.backgroundColor = COLOR_HEX(0xE8E8E8);
    return view;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    if (section == 0) {
        return 0.01f;
    }
    return scaleTopAndBottom(10);
}
/**
 tablview的选中状体

 @return
 */



#pragma mark-tablview的选中状态



-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section == 1) {
        switch (indexPath.row) {
            case 0:{
                if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] integerValue] == 1) {
                    MyCompetitionViewController *mycompetionVc = [[MyCompetitionViewController alloc] init];
                    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:mycompetionVc];
                    nav.transitioningDelegate = self;
                    nav.modalPresentationStyle = UIModalPresentationCustom;
                    [self presentViewController:nav animated:YES completion:nil];
                }else if([[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] integerValue] == 2){
                    MyEmblemViewController *myemlemVc = [[MyEmblemViewController alloc] init];
                    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:myemlemVc];
                    nav.transitioningDelegate = self;
                    nav.modalPresentationStyle = UIModalPresentationCustom;
                    [self presentViewController:nav animated:YES completion:nil];
                }

            }
                break;
            case 1:{
                if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] integerValue] == 1) {
                    MyCollectionViewController *collecVc = [[MyCollectionViewController alloc] init];
                    UINavigationController *collectNav = [[UINavigationController alloc] initWithRootViewController:collecVc];
                    collectNav.transitioningDelegate = self;
                    collectNav.modalPresentationStyle = UIModalPresentationCustom;
                    [self presentViewController:collectNav animated:YES completion:nil];
                }else if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Identity"] integerValue] == 2){
                    MyInstitutionViewController *myemlemVc = [[MyInstitutionViewController alloc] init];
                    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:myemlemVc];
                    nav.transitioningDelegate = self;
                    nav.modalPresentationStyle = UIModalPresentationCustom;
                    [self presentViewController:nav animated:YES completion:nil];
                }

                
            }
                break;
            case 2:{
                MyEmblemViewController *myemlemVc = [[MyEmblemViewController alloc] init];
                UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:myemlemVc];
                nav.transitioningDelegate = self;
                nav.modalPresentationStyle = UIModalPresentationCustom;
                [self presentViewController:nav animated:YES completion:nil];
            }
                break;
            case 3:{
                
                MydataEditViewController *editVc = [[MydataEditViewController alloc] init];
                editVc.personBlock = ^(NSDictionary *dict, UIImage *imge) {
                    self.personDict = dict;
                    self.backImage = imge;
                    NSLog(@"个人字典信息%@",self.personDict);
                };
                [self.navigationController pushViewController:editVc animated:YES];
//                UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:editVc];
//                nav.transitioningDelegate = self;
//                nav.modalPresentationStyle = UIModalPresentationCustom;
//                [self presentViewController:nav animated:YES completion:nil];
            }
                break;
            default:
                break;
        }
    }else if(indexPath.section == 2){
        switch (indexPath.row) {
            case 0:
            {
                AddressManagerViewController *addressVc = [[AddressManagerViewController alloc] init];
                addressVc.isFromSetting = YES;
                UINavigationController *addressNav = [[UINavigationController alloc] initWithRootViewController:addressVc];
                
                addressNav.transitioningDelegate = self;
                addressNav.modalPresentationStyle = UIModalPresentationCustom;
                [self presentViewController:addressNav animated:YES completion:nil];
//                MyShoppingCarViewController *shopingCarVc = [[MyShoppingCarViewController alloc] init];
//                UINavigationController *navVc = [[UINavigationController alloc] initWithRootViewController:shopingCarVc];
//                navVc.transitioningDelegate = self;
//                navVc.modalPresentationStyle = UIModalPresentationCustom;
//                [self presentViewController:navVc animated:YES completion:nil];
            }
                break;
            case 1:
            {
                MyOrderViewController *myorderVc = [[MyOrderViewController alloc] init];
                UINavigationController *navVc = [[UINavigationController alloc] initWithRootViewController:myorderVc];
                navVc.transitioningDelegate = self;
                navVc.modalPresentationStyle = UIModalPresentationCustom;
                [self presentViewController:navVc animated:YES completion:nil];
            }
                break;
            case 2:
            {
                AddressManagerViewController *addressVc = [[AddressManagerViewController alloc] init];
                addressVc.isFromSetting = YES;
                UINavigationController *addressNav = [[UINavigationController alloc] initWithRootViewController:addressVc];
                
                addressNav.transitioningDelegate = self;
                addressNav.modalPresentationStyle = UIModalPresentationCustom;
                [self presentViewController:addressNav animated:YES completion:nil];
            }
                break;
            default:
                break;
        }
    }else if(indexPath.section == 3){
        if (indexPath.row == 1 ) {
            MySuggestionBackViewController *suggestVc = [[MySuggestionBackViewController alloc] init];
            UINavigationController *suggestNav = [[UINavigationController alloc] initWithRootViewController:suggestVc];
            suggestNav.transitioningDelegate = self;
            suggestNav.modalPresentationStyle = UIModalPresentationCustom;
            [self presentViewController:suggestNav animated:YES completion:nil];
        }
        if (indexPath.row == 2) {
            [self showShareUI];
        }else{
            MyPersonSettingViewController *setVc = [[MyPersonSettingViewController alloc] init];
            [self.navigationController pushViewController:setVc animated:YES];
//            UINavigationController *setNav = [[UINavigationController alloc] initWithRootViewController:setVc];
//            setNav.transitioningDelegate = self;
//            setNav.modalPresentationStyle = UIModalPresentationCustom;
//            [self presentViewController:setNav animated:YES completion:nil];
        }
    }else{
        
    }
}

-(void)showShareUI{
    UIView *backView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    backView.alpha = 0.5f;
    backView.backgroundColor = [UIColor blackColor];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removebackView:)];
    [backView addGestureRecognizer:tap];
    [[UIApplication sharedApplication].keyWindow addSubview:backView];
    _shareView = [[QQAndWechatShareView alloc] initWithFrame:CGRectMake(0, HEIGHT, WIDTH, scaleTopAndBottom(94))];
    [_shareView.QQBtn addTarget:self action:@selector(QQShare:) forControlEvents:UIControlEventTouchUpInside];
    [_shareView.WechatBtn addTarget:self action:@selector(WechatShare:) forControlEvents:UIControlEventTouchUpInside];
    [[UIApplication sharedApplication].keyWindow addSubview:_shareView];
    [UIView animateWithDuration:0.1 animations:^{
        _shareView.frame = CGRectMake(0,HEIGHT - scaleTopAndBottom(94), WIDTH, scaleTopAndBottom(94));
    }];
}
-(void)WechatShare:(UIButton *)btn{
    /** 标题
     * @note 长度不能超过512字节
     */
    // @property (nonatomic, retain) NSString *title;
    /** 描述内容
     * @note 长度不能超过1K
     */
    //@property (nonatomic, retain) NSString *description;
    /** 缩略图数据
     * @note 大小不能超过32K
     */
    //  @property (nonatomic, retain) NSData   *thumbData;
    /**
     * @note 长度不能超过64字节
     */
    // @property (nonatomic, retain) NSString *mediaTagName;
    /**
     * 多媒体数据对象，可以为WXImageObject，WXMusicObject，WXVideoObject，WXWebpageObject等。
     */
    // @property (nonatomic, retain) id        mediaObject;
    
    /*! @brief 设置消息缩略图的方法
     *
     * @param image 缩略图
     * @note 大小不能超过32K
     */
    //- (void) setThumbImage:(UIImage *)image;
    //缩略图
    UIImage *image = [UIImage imageNamed:@"LOGO4"];
    WXMediaMessage *message = [WXMediaMessage message];
    message.title = @"与艺术相伴,记忆成长的乐趣";
    message.description = @"趣味赛事,课外知识,艺术之旅,尽在途吉";
    //png图片压缩成data的方法，如果是jpg就要用 UIImageJPEGRepresentation
    message.thumbData = UIImagePNGRepresentation(image);
    [message setThumbImage:image];
    
    
    WXWebpageObject *ext = [WXWebpageObject object];
    ext.webpageUrl = @"http://test.tj698.com/h5/downLoad";
    message.mediaObject = ext;
    message.mediaTagName = @"ISOFTEN_TAG_JUMP_SHOWRANK";
    
    SendMessageToWXReq *sentMsg = [[SendMessageToWXReq alloc]init];
    sentMsg.message = message;
    sentMsg.bText = NO;
    sentMsg.scene =  WXSceneSession;
//    //选择发送到会话(WXSceneSession)或者朋友圈(WXSceneTimeline)
//    if (isPengyouquan) {
//        sentMsg.scene = WXSceneTimeline;  //分享到朋友圈
//    }else{
//        sentMsg.scene =  WXSceneSession;  //分享到会话。
//    }
    
    //如果我们想要监听是否成功分享，我们就要去appdelegate里面 找到他的回调方法
    // -(void) onResp:(BaseResp*)resp .我们可以自定义一个代理方法，然后把分享的结果返回回来。
    appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
    //添加对appdelgate的微信分享的代理
//    appdelegate.wxDelegate = self;
    BOOL isSuccess = [WXApi sendReq:sentMsg];
}
-(void)QQShare:(UIButton *)btn{
    //创建分享消息对象
    UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
    
    //创建网页内容对象
    NSString* thumbURL =  @"http://www.tj698.com/resource/img/logo.png";
    UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:@"与艺术相伴,记忆成长的乐趣" descr:@"趣味赛事,课外知识,艺术之旅,尽在途吉" thumImage:thumbURL];
    //设置网页地址
    shareObject.webpageUrl = @"http://test.tj698.com/h5/downLoad";
    
    //分享消息对象设置分享内容对象
    messageObject.shareObject = shareObject;
    
    //调用分享接口
    [[UMSocialManager defaultManager] shareToPlatform:UMSocialPlatformType_QQ messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
        if (error) {
            UMSocialLogInfo(@"************Share fail with error %@*********",error);
        }else{
            if ([data isKindOfClass:[UMSocialShareResponse class]]) {
                UMSocialShareResponse *resp = data;
                //分享结果消息
                UMSocialLogInfo(@"response message is %@",resp.message);
                //第三方原始返回的数据
                UMSocialLogInfo(@"response originalResponse data is %@",resp.originalResponse);
                
            }else{
                UMSocialLogInfo(@"response data is %@",data);
            }
        }
    }];

}
-(void)removebackView:(UITapGestureRecognizer *)tap{
    
    [UIView animateWithDuration:0.1 animations:^{
        UIView *view = tap.view;
        [view removeFromSuperview];
        [_shareView removeFromSuperview];
    }];
}
-(void)ButtonOnclick:(UIButton *)btn{
    if (btn.tag == 10001) {
        
        MyMoneyViewController *moneyVc = [[MyMoneyViewController alloc] init];
        [self.navigationController pushViewController:moneyVc animated:YES];
//        UINavigationController *moneyNav = [[UINavigationController alloc] initWithRootViewController:moneyVc];
//        moneyNav.navigationController.navigationBar.subviews.firstObject.alpha = 0.0f;
//        moneyNav.transitioningDelegate = self;
//        moneyNav.modalPresentationStyle = UIModalPresentationCustom;
//        [self presentViewController:moneyNav animated:YES completion:nil];
    }
    if (btn.tag == 10002) {
        NSLog(@"点击了");
        
        MyAttentionViewController *attentionVc = [[MyAttentionViewController alloc] init];
        UINavigationController *attentionNav = [[UINavigationController alloc] initWithRootViewController:attentionVc];
        attentionNav.transitioningDelegate = self;
        attentionNav.modalPresentationStyle = UIModalPresentationCustom;
        [self presentViewController:attentionNav animated:YES completion:nil];
        
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


-(NSArray *)firstTitileArray{
    if (_firstTitileArray == nil) {
       _firstTitileArray = @[@"我的赛事",@"我的收藏",@"途吉徽章",@"编辑资料"];
    }
    return _firstTitileArray;
}
-(NSArray *)firstTitileInstituArray{
    if (_firstTitileInstituArray == nil) {
        _firstTitileInstituArray = @[@"途吉徽章",@"我的机构"];
    }
    return _firstTitileInstituArray;
}
-(NSArray *)firstImagsArray{
    if (_firstImagsArray == nil) {
        _firstImagsArray = @[@"showmesaishi",@"showmeshoucang",@"showmehuizhang",@"showmexiaoka"];
    }
    return _firstImagsArray;
}
-(NSArray *)firstImagsInsituArray{
    if (_firstImagsInsituArray == nil) {
        _firstImagsInsituArray = @[@"showmehuizhang",@"showmexiaoka"];
    }
    return _firstImagsInsituArray;
}

-(NSArray *)twoImagsArray{
    if (_twoImagsArray == nil) {
       _twoImagsArray = @[@"showmeAddress"];
    }
    return _twoImagsArray;
}
-(NSArray *)twoImagsInsituArray{
    if (_twoImagsInsituArray == nil) {
        _twoImagsInsituArray = @[@"showmeAddress"];
    }
    return _twoImagsInsituArray;
}
-(NSArray *)threeImagsArray{
    if (_threeImagsArray == nil) {
        _threeImagsArray = @[@"showmeshezhi",@"showmeyijian",@"showmefenxiang"];
    }
    return _threeImagsArray;
}
-(NSArray *)secondTitileArray{
    if (_secondTitileArray == nil) {
       _secondTitileArray = @[@"地址管理"];
    }
    return _secondTitileArray;
}
-(NSArray *)threeTitleArray{
    if (_threeTitleArray == nil) {
        _threeTitleArray = @[@"常用设置",@"意见反馈",@"分享APP"];
    }
    return _threeTitleArray;
}

/**
 创建标签

 */
-(void)createLabelsInView:(UIView *)view AndunderView:(UIView *)underView{
    NSString *inters;
    if ([[NSUserDefaults standardUserDefaults] objectForKey:@"INTERST"]) {
           inters = [[NSUserDefaults standardUserDefaults] objectForKey:@"INTERST"];
    }
    if ([self.personDict allKeys].count != 0) {
        inters = self.personDict[@"interest"];
    }
    NSArray *labelArra = [inters componentsSeparatedByString:@","];
    NSMutableArray *countsArrat = [[NSMutableArray alloc] init];
    for (NSInteger i = 0; i < 3; i++) {
        UILabel *label = [[UILabel alloc] init];
        label.textColor = [UIColor whiteColor];
        label.textAlignment = NSTextAlignmentCenter;
        label.font = [UIFont systemFontOfSize:11];
        label.backgroundColor = [UIColor clearColor];
        label.alpha = 0.9;
        label.layer.cornerRadius = 2;
        label.layer.masksToBounds = YES;
        label.text = labelArra[i];
        label.adjustsFontSizeToFitWidth = YES;
        [view addSubview:label];
        [countsArrat addObject:label];
    }
    
    [countsArrat mas_distributeViewsAlongAxis:MASAxisTypeHorizontal withFixedSpacing:10 leadSpacing:100 tailSpacing:100];
    [countsArrat mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(underView.mas_bottom).offset(scaleTopAndBottom(5));
        make.height.equalTo(@20);
    }];

}

/**
 获得用户等级
 */
-(void)getUserGrad{
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    NSString *url = ServerIp@"/gradeApp/regetCustomerGrade";
    NSString *sessionId = [[NSUserDefaults standardUserDefaults] objectForKey:@"sessionId"];
    NSDictionary *param = [NSDictionary dictionaryWithObjectsAndKeys:sessionId,@"sessionId", nil];
    [manager POST:url parameters:param progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *jsonDic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
        NSLog(@"用户等级数据信息%@",jsonDic);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        NSLog(@"%@",error);
    }];
}

/**
 获得用户的积分
 */
-(void)getUserScore{
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    NSString *url = ServerIp@"/gradeApp/integralRecordList";
    NSString *sessionId = [[NSUserDefaults standardUserDefaults] objectForKey:@"sessionId"];
    NSDictionary *param = [NSDictionary dictionaryWithObjectsAndKeys:sessionId,@"sessionId", nil];
    [manager POST:url parameters:param progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *jsonDic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
        NSLog(@"用户积分的数据%@",jsonDic);
        NSArray *scoreArra = jsonDic[@"list"];
        self.userScore = [NSString stringWithFormat:@"%ld",scoreArra.count];
        [self createTableViewUI];
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
}

-(NSDictionary *)personDict{
    if (_personDict == nil) {
        _personDict = [[NSDictionary alloc] init];
    }
    return _personDict;
}

/**
 注册之后进行身份或者机构的认证
 */
-(void)createPeopleCountChooseView{
    UIImageView *firstImageView = [[UIImageView alloc] init];
    firstImageView.userInteractionEnabled = YES;
    firstImageView.tag = 100100;
    UITapGestureRecognizer *personaltap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(choosePersonalInput:)];
    [firstImageView addGestureRecognizer:personaltap];
    [self.view addSubview:firstImageView];
    [firstImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view.mas_top).offset(scaleTopAndBottom(5) + 64);
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(227), scaleLeftAndRight(272)));
    }];
    UIImageView *secondImageView = [[UIImageView alloc] init];
    secondImageView.userInteractionEnabled = YES;
    secondImageView.tag = 100200;
    UITapGestureRecognizer *institTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(choosePersonalInput:)];
    [secondImageView addGestureRecognizer:institTap];
    [self.view addSubview:secondImageView];
    [secondImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(firstImageView.mas_bottom).offset(scaleTopAndBottom(15));
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(204), scaleLeftAndRight(256)));
    }];
    firstImageView.image = [UIImage imageNamed:@"personID"];
    secondImageView.image = [UIImage imageNamed:@"JIGOUID"];
    UILabel *bottomLabel = [[UILabel alloc] init];
    bottomLabel.userInteractionEnabled = YES;
    bottomLabel.textAlignment = NSTextAlignmentRight;
    bottomLabel.text = @"悄悄走过";
    bottomLabel.tag = 100300;
    bottomLabel.textColor = COLOR_HEX(0xf4d11f);
    [self.view addSubview:bottomLabel];
    [bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(scaleLeftAndRight(-15));
            make.height.mas_equalTo(scaleTopAndBottom(20));
        make.bottom.equalTo(self.view.mas_bottom).offset(scaleTopAndBottom(-15));
            make.left.equalTo(self.view.mas_left);
    }];
    UITapGestureRecognizer *randomTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(choosePersonalInput:)];
    [bottomLabel addGestureRecognizer:randomTap];
}
-(void)choosePersonalInput:(UITapGestureRecognizer *)tap{
    self.chooseTypeId = [NSString stringWithFormat:@"%ld",tap.view.tag];
        [self showTypeChooseSureOrCancelView];
}

/**
 根据选择类型选择身份认证

 @param identity 身份ID
 */
-(void)chooseUserType:(NSString *)identity AndPresentViewController:(LoginUserViewController *)Vc{
    Vc.chooseTypeId = identity;
    [self.navigationController pushViewController:Vc animated:YES];
//    Vc.transitioningDelegate = self;
//    Vc.modalPresentationStyle = UIModalPresentationCustom;
//    [self presentViewController:Vc animated:YES completion:nil];
    
//    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
//    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
//        NSString *sessionId = [[NSUserDefaults standardUserDefaults] objectForKey:@"sessionId"];
//    NSDictionary *param = [NSDictionary dictionaryWithObjectsAndKeys:sessionId,@"sessionId",identity,@"identity", nil];
//    NSString *url = ServerIp@"/customerApp/updateIdentity";
//    [manager POST:url parameters:param progress:^(NSProgress * _Nonnull uploadProgress) {
//
//    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
//        NSDictionary *jsonDic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
//        NSLog(@"%@",jsonDic[@"msg"]);
//
//
//    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
//        NSLog(@"错误信息%@",error);
//    }];
}
-(void)showTypeChooseSureOrCancelView{
    
    self.backView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.backView.alpha = 0.5f;
    self.backView.backgroundColor = [UIColor blackColor];
    //    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removebackView:)];
    //    [backView addGestureRecognizer:tap];
    [self.view addSubview:self.backView];
    self.submitView = [[InstituSubmiteOverView alloc] initWithFrame:CGRectZero];
    _submitView.imageV.image = [UIImage imageNamed:@"矩形-5"];
    [self.view addSubview:_submitView];
    [_submitView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.view);
        make.size.mas_equalTo(CGSizeMake(0, 0));
    }];
    [UIView animateWithDuration:1.0f animations:^{
        [_submitView mas_updateConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(232), scaleTopAndBottom(254)));
        }];
        
    }];
    UITapGestureRecognizer *tapss = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapViewToSure:)];
    UIView *sureView = [[UIView alloc] init];
    [_submitView addSubview:sureView];
    [sureView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.bottom.equalTo(_submitView);
        make.left.equalTo(_submitView.mas_centerX);
        make.height.mas_equalTo(scaleTopAndBottom(70));
//        make.size.mas_equalTo(CGSizeMake(100, 60));
    }];
    [sureView addGestureRecognizer:tapss];
    
    UITapGestureRecognizer *tapdd = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removesbackView:)];
    UIView *deletedView = [[UIView alloc] init];
    [_submitView addSubview:deletedView];
    [deletedView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.equalTo(_submitView);
        make.right.equalTo(_submitView.mas_centerX);
        make.height.mas_equalTo(scaleTopAndBottom(70));
//        make.size.mas_equalTo(CGSizeMake(100, 60));
    }];
    [deletedView addGestureRecognizer:tapdd];
}
-(void)tapViewToSure:(UITapGestureRecognizer *)tap{
    [UIView animateWithDuration:0.1 animations:^{
        //        UIView *view = tap.view;
        [self.backView removeFromSuperview];
        [_submitView removeFromSuperview];
    }];
        NSLog(@"你点击了确定的部分%@",self.chooseTypeId);
    if ([self.chooseTypeId integerValue] == 100100) {
        LoginUserViewController *loginVc = [[LoginUserViewController alloc] init];
        
        [self chooseUserType:@"1" AndPresentViewController:loginVc];
//        MydataEditViewController *editVc = [[MydataEditViewController alloc] init];
//        editVc.personBlock = ^(NSDictionary *dict, UIImage *imge) {
//            self.personDict = dict;
//            self.backImage = imge;
//            NSLog(@"个人字典信息%@",self.personDict);
//        };
//        [self chooseUserType:@"1" AndPresentViewController:editVc];
    }else{
        LoginUserViewController *loginVc = [[LoginUserViewController alloc] init];
        
        [self chooseUserType:@"2" AndPresentViewController:loginVc];
//        OrganationApplayINViewController *orgApplyInVc = [[OrganationApplayINViewController alloc] init];
//        [self chooseUserType:@"2" AndPresentViewController:orgApplyInVc];
    }


}
-(void)removesbackView:(UITapGestureRecognizer *)tap{
    [UIView animateWithDuration:0.1 animations:^{
        //        UIView *view = tap.view;
        [self.backView removeFromSuperview];
        [_submitView removeFromSuperview];
    }];
    NSLog(@"你点击了取消的部分");

}
@end
